package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.JtExpressDeliveryCompanyMapper;
import com.ruoyi.business.domain.JtExpressDeliveryCompany;
import com.ruoyi.business.service.IJtExpressDeliveryCompanyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 快递物流公司Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-06-11
 */
@Service
public class JtExpressDeliveryCompanyServiceImpl implements IJtExpressDeliveryCompanyService 
{
    @Autowired
    private JtExpressDeliveryCompanyMapper jtExpressDeliveryCompanyMapper;

    /**
     * 查询快递物流公司
     * 
     * @param expressId 快递物流公司主键
     * @return 快递物流公司
     */
    @Override
    public JtExpressDeliveryCompany selectJtExpressDeliveryCompanyByExpressId(Long expressId)
    {
        return jtExpressDeliveryCompanyMapper.selectJtExpressDeliveryCompanyByExpressId(expressId);
    }

    /**
     * 查询快递物流公司列表
     * 
     * @param jtExpressDeliveryCompany 快递物流公司
     * @return 快递物流公司
     */
    @Override
    public List<JtExpressDeliveryCompany> selectJtExpressDeliveryCompanyList(JtExpressDeliveryCompany jtExpressDeliveryCompany)
    {
        return jtExpressDeliveryCompanyMapper.selectJtExpressDeliveryCompanyList(jtExpressDeliveryCompany);
    }

    /**
     * 新增快递物流公司
     * 
     * @param jtExpressDeliveryCompany 快递物流公司
     * @return 结果
     */
    @Override
    public int insertJtExpressDeliveryCompany(JtExpressDeliveryCompany jtExpressDeliveryCompany)
    {
        jtExpressDeliveryCompany.setCreateBy(ShiroUtils.getSysUser().getUserName());
        jtExpressDeliveryCompany.setCreateTime(DateUtils.getNowDate());
        return jtExpressDeliveryCompanyMapper.insertJtExpressDeliveryCompany(jtExpressDeliveryCompany);
    }

    /**
     * 修改快递物流公司
     * 
     * @param jtExpressDeliveryCompany 快递物流公司
     * @return 结果
     */
    @Override
    public int updateJtExpressDeliveryCompany(JtExpressDeliveryCompany jtExpressDeliveryCompany)
    {
        jtExpressDeliveryCompany.setUpdateBy(ShiroUtils.getSysUser().getUserName());
        jtExpressDeliveryCompany.setUpdateTime(DateUtils.getNowDate());
        return jtExpressDeliveryCompanyMapper.updateJtExpressDeliveryCompany(jtExpressDeliveryCompany);
    }

    /**
     * 批量删除快递物流公司
     * 
     * @param expressIds 需要删除的快递物流公司主键
     * @return 结果
     */
    @Override
    public int deleteJtExpressDeliveryCompanyByExpressIds(String expressIds)
    {
        return jtExpressDeliveryCompanyMapper.deleteJtExpressDeliveryCompanyByExpressIds(Convert.toStrArray(expressIds));
    }

    /**
     * 删除快递物流公司信息
     * 
     * @param expressId 快递物流公司主键
     * @return 结果
     */
    @Override
    public int deleteJtExpressDeliveryCompanyByExpressId(Long expressId)
    {
        return jtExpressDeliveryCompanyMapper.deleteJtExpressDeliveryCompanyByExpressId(expressId);
    }
}
